home *** CD-ROM | disk | FTP | other *** search
- /*
- * (c) Copyright 1992 by Panagiotis Tsirigotis
- * All rights reserved. The file named COPYRIGHT specifies the terms
- * and conditions for redistribution.
- */
-
-
- #ifndef __STR_H
- #define __STR_H
-
- /*
- * $Id: str.h,v 1.5 1992/12/07 06:52:50 panos Exp $
- */
-
- #include <varargs.h>
-
- /*
- * Return values
- */
- #define STR_OK 0
- #define STR_ERR (-1)
-
-
- /*
- * Flags
- */
- #define STR_NOFLAGS 0x0
- #define STR_RETURN_ERROR 0x1
- #define STR_NULL_START 0x2
- #define STR_NULL_END 0x4
- #define STR_MALLOC 0x8
-
- extern int str_errno ;
-
- /*
- * Error values
- */
- #define STR_ENULLSEPAR 1
- #define STR_ENULLSTRING 2
- #define STR_ENOMEM 3
-
-
- #ifdef __ARGS
- #undef __ARGS
- #endif
-
- #ifdef PROTOTYPES
- # define __ARGS( s ) s
- #else
- # define __ARGS( s ) ()
- #endif
-
-
- /*
- * strprint(3) functions
- */
- char *str_sprint __ARGS( ( char *buf, char *fmt, ... ) ) ;
- int str_nprint __ARGS( ( char *buf, char *fmt, ... ) ) ;
- void str_print __ARGS( ( int *count, char *buf, char *fmt, ... ) ) ;
-
- char *str_sprintv __ARGS( ( char *buf, char *fmt, va_list ) ) ;
- int str_nprintv __ARGS( ( char *buf, char *fmt, va_list ) ) ;
- void str_printv __ARGS( ( int *count, char *buf, char *fmt, va_list ) ) ;
-
- char *strx_sprint __ARGS( ( char *buf, int len, char *fmt, ... ) ) ;
- int strx_nprint __ARGS( ( char *buf, int len, char *fmt, ... ) ) ;
- void strx_print __ARGS( ( int *count, char *buf, int len, char *fmt, ... ) ) ;
-
- char *strx_sprintv __ARGS( ( char *buf, int len, char *fmt, va_list ) ) ;
- int strx_nprintv __ARGS( ( char *buf, int len, char *fmt, va_list ) ) ;
- void strx_printv __ARGS(( int *cnt, char *buf, int len, char *fmt, va_list )) ;
-
-
- /*
- * strparse(3) functions
- */
- typedef void *str_h ;
-
- str_h str_parse __ARGS( ( char *str, char *separ, int flags, int *errnop ) ) ;
- void str_endparse __ARGS( ( str_h handle ) ) ;
- char *str_component __ARGS( ( str_h handle ) ) ;
- int str_setstr __ARGS( ( str_h handle, char *newstr ) ) ;
- int str_separator __ARGS( ( str_h handle, char *separ ) ) ;
- char *str_nextpos __ARGS( ( str_h handle ) ) ;
-
- /*
- * For backwards compatibility
- */
- #define str_process( s, sep, flags ) str_parse( s, sep, flags, (int *)0 )
- #define str_endprocess( handle ) str_endparse( handle )
-
-
- /*
- * strutil(3) functions
- */
- char *str_find __ARGS( ( char *s1, char *s2 ) ) ;
- char *str_casefind __ARGS( ( char *s1, char *s2 ) ) ;
- void str_fill __ARGS( ( char *s, char c ) ) ;
- char *str_lower __ARGS( ( char *s ) ) ;
- char *str_upper __ARGS( ( char *s ) ) ;
-
- #endif /* __STR_H */
-
-